﻿<UserControl x:Class="TeamProjectManager.Shell.Modules.Logo.LogoView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        
        <StackPanel Grid.Column="0" Orientation="Vertical" VerticalAlignment="Top">
            <StackPanel.Resources>
                <Style x:Key="FaderStyle" TargetType="{x:Type TextBlock}">
                    <Style.Resources>
                        <Storyboard x:Key="FadeStoryboard">
                            <DoubleAnimation Storyboard.TargetProperty="(TextBlock.Opacity)" From="0.6" To="1.0" Duration="0:0:0.5" RepeatBehavior="0:0:5" AutoReverse="True" />
                        </Storyboard>
                    </Style.Resources>
                    <Style.Triggers>
                        <Trigger Property="Visibility" Value="Visible">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource FadeStoryboard}" />
                            </Trigger.EnterActions>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </StackPanel.Resources>
            <TextBlock Text="{Binding Path=HeaderTitle, Converter={StaticResource caseConverter}, ConverterParameter=upper}" FontSize="14" FontWeight="DemiBold" Foreground="{StaticResource AccentBrush}" />
            <TextBlock Text="{Binding Path=HeaderSubtitle, Converter={StaticResource caseConverter}, ConverterParameter=lower}" FontSize="11" Foreground="{StaticResource UserMessageFontBrush}" />
            <TextBlock Style="{StaticResource FaderStyle}" Opacity="0.6" Visibility="{Binding NewVersionVisibility}">
                <Hyperlink NavigateUri="{Binding NewVersionUrl}" x:Name="downloadNewVersionHyperLink" RequestNavigate="downloadNewVersionHyperLink_RequestNavigate"><Run Text="{Binding NewVersionMessage}" /></Hyperlink>
            </TextBlock>
        </StackPanel>
        
        <Expander Grid.Column="1" IsExpanded="False" ExpandDirection="Right" ToolTip="Support" Padding="5,0,0,0">
            <StackPanel Orientation="Vertical">
                <TextBlock><Hyperlink Command="{Binding Path=OpenLogFileCommand}">open log file</Hyperlink></TextBlock>
                <TextBlock><Hyperlink Command="{Binding Path=OpenHomepageCommand}">go to homepage</Hyperlink></TextBlock>
            </StackPanel>
        </Expander>
    </Grid>
</UserControl>